<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        strong{
            color: red;
        }
    </style>
</head>
<body>
<form action="list" method="get" id="searchForm">
    <input type="text" name="title" value="${title}">
    <input type="hidden" name="pageno" id="pageno">
    <input type="submit" value="查询">
</form>
<a href="news/list">新闻管理</a>
<#list newsEntityPage.highlighted as entry>
    <p>${entry.entity.title} —— ${entry.entity.author}</p>
</#list>
<#if newsEntityPage??>
    <p>
        共${newsEntityPage.totalElements}条记录 [${newsEntityPage.number+1}/${newsEntityPage.totalPages-1}]
        <#if newsEntityPage.hasPrevious()>
            <a href="javascript:;" onclick="to_page(1)">首页</a>
            <a href="javascript:;" onclick="to_page(${newsEntityPage.number - 1})">上一页</a>
        </#if>
        <#if newsEntityPage.hasNext()>
            <a href="javascript:;" onclick="to_page(${newsEntityPage.number + 1})">下一页</a>
            <a href="javascript:;" onclick="to_page(${newsEntityPage.totalPages-1})">末页</a>
        </#if>
    </p>
</#if>
<script type="text/javascript">
    function to_page(pageno) {
        document.getElementById("pageno").value = pageno;
        document.getElementById("searchForm").submit();
    }
</script>
</body>
</html>